QT       += core gui x11extras dbus KWindowSystem KGlobalAccel

DEFINES += APP_VERSION=\\\"$$TAG_VERSION\\\"

PKGCONFIG += kysdk-qtwidgets kysdk-waylandhelper kysdk-log kysdk-config kysdk-utils kysdk-kabase
#sdk不一样的版本路径有更改
INCLUDEPATH += /usr/include/kabase/
INCLUDEPATH += /usr/include/kysdk/applications/kabase/kylin_system/
INCLUDEPATH += /usr/include/kabase/kylin_system/
INCLUDEPATH += /usr/include/kysdk/applications/kabase/

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = kylin-screencap
CONFIG += c++11 link_pkgconfigt
MOC_DIR += .moc
#PKGCONFIG += gsettings-qt wayland-client
TRANSLATIONS += ./translations/kylin-screencap_zh_CN.ts \
    ./translations/kylin-screencap_zh_CN.ts \
    ./translations/kylin-screencap_bo_CN.ts \
    ./translations/kylin-screencap_zh_HK.ts \
    ./translations/kylin-screencap_zh_TW.ts \
    ./translations/kylin-screencap_mn.ts
!system($$PWD/translations/generate_translations_pm.sh): error("Failed to generate pm")

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0


# singleapplication
include(third-party/singleapplication/singleapplication.pri)
DEFINES += QAPPLICATION_CLASS=QApplication

# gstreamer
PKGCONFIG += gstreamer-1.0
INCLUDEPATH += /usr/include/gstreamer-1.0 \
               /usr/include/glib-2.0 \
               /usr/lib/x86_64-linux-gnu/glib-2.0/include \
LIBS += -lgstreamer-1.0 \
        -lgobject-2.0 \
        -lglib-2.0 \


unix:CONFIG += link_pkgconfig
unix:PKGCONFIG += gstreamer-1.0
unix:PKGCONFIG += libpulse
#unix:PKGCONFIG += wayland-client
unix:LIBS += -lpulse-simple
LIBS += -lX11 -lXext -lukui-log4qt

# Player
unix:PKGCONFIG += gstreamer-video-1.0
unix:PKGCONFIG += gstreamer-pbutils-1.0
unix:PKGCONFIG += glib-2.0

# KF5WindowSystem
INCLUDEPATH += /usr/include/KF5/KWindowSystem/

# 添加 GSettings 库路径和链接库
PKGCONFIG += gsettings-qt
#INCLUDEPATH += /usr/include/*-linux-gnu/qt5/QGSettings
#LIBS += -L/usr/lib/*-linux-gnu/ -lgsettings-qt

# 适配窗口管理器圆角阴影
LIBS +=-lpthread
LIBS +=-lX11

# showkey
include(showkey/showkey.pri)
include(showclick/showclick.pri)

# 快捷键
INCLUDEPATH += /usr/include/KF5/KConfigGui/
LIBS += -L/usr/lib/*-linux-gnu/ -lKF5ConfigGui

# 数据埋点
PKGCONFIG += kysdk-datacollect

# 摄像头
QT += multimedia
INCLUDEPATH += /usr/include/kylincameralibs/
LIBS += -lkylincamera \

SOURCES += \
    camera/currentdeviceinfo.cpp \
    camera/devicepull.cpp \
    camera/deviceread.cpp \
    camera/globalinstance.cpp \
    camera/login1_dbus.cpp \
    core/flameshotdbusadapter.cpp \
    main.cpp \
    global/global.cpp \
    utils/cli/commandargument.cpp \
    utils/cli/commandlineparser.cpp \
    utils/cli/commandoption.cpp \
    utils/confighandler.cpp \
    utils/desktopinfo.cpp \
    utils/globalkey.cpp \
    utils/screencapsaver.cpp \
    utils/screengrabber.cpp \
    utils/systemnotification.cpp \
    utils/xatom-helper.cpp \
    widgets/camerapage.cpp \
    widgets/capturewidget.cpp \
    widgets/customprogressbar.cpp \
    widgets/leadwidget.cpp \
    widgets/recordingwidget.cpp \
    widgets/selectionwidget.cpp \
    widgets/settingwidget.cpp \
    widgets/shortcut.cpp \
    widgets/shortcutlineedit.cpp \
    widgets/statusbar.cpp \
    widgets/cutdown.cpp \
    widgets/toolbar.cpp \
    widgets/trayicon.cpp \
    core/controller.cpp \
    core/capturerequest.cpp \
    core/core.cpp \
    core/devices.c \
    core/core_wl.cpp

HEADERS += \
    camera/currentdeviceinfo.h \
    camera/devicepull.h \
    camera/deviceread.h \
    camera/globalinstance.h \
    camera/login1_dbus.h \
    core/flameshotdbusadapter.h \
    global/global.h \
    utils/cli/commandargument.h \
    utils/cli/commandlineparser.h \
    utils/cli/commandoption.h \
    utils/confighandler.h \
    utils/desktopinfo.h \
    utils/globalkey.h \
    utils/screencapsaver.h \
    utils/screengrabber.h \
    utils/systemnotification.h \
    utils/xatom-helper.h \
    widgets/camerapage.h \
    widgets/capturewidget.h \
    widgets/customprogressbar.h \
    widgets/leadwidget.h \
    widgets/recordingwidget.h \
    widgets/selectionwidget.h \
    widgets/settingwidget.h \
    widgets/shortcut.h \
    widgets/shortcutlineedit.h \
    widgets/statusbar.h \
    widgets/cutdown.h \
    widgets/toolbar.h \
    widgets/trayicon.h \
    core/capturerequest.h \
    core/controller.h \
    core/core.h \
    core/devices.h \
    core/core_wl.h

LIBS += -lX11 -lXext

# Default rules for deployment.
#qnx: target.path = /tmp/$${TARGET}/bin
#else: unix:!android: target.path = /opt/$${TARGET}/bin
#!isEmpty(target.path): INSTALLS += target

unix {
    target.path = /usr/bin/
    INSTALLS += target

    desktop.path = /usr/share/applications/
    desktop.files = ../kylin-screencap.desktop
    INSTALLS += desktop

    gsettings.path = /usr/share/glib-2.0/schemas/
    gsettings.files = ../data/org.ukui.screencap.gschema.xml
    INSTALLS += gsettings

    helpfiles.path =  /usr/share/kylin-user-guide/data/guide/
    helpfiles.files = ../data/kylin-screencap/
    INSTALLS += helpfiles

    translation.path = /usr/share/kylin-screencap/translations/
    translation.files += translations/*.qm
    INSTALLS += translation

    dbus_xml.path = /usr/share/dbus-1/interfaces/
    dbus_xml.files = ../dbus/org.dharkael.kylinscreencap.xml
    INSTALLS += dbus_xml

    dbus_service.path = /usr/share/dbus-1/services/
    dbus_service.files = ../dbus/package/org.dharkael.kylinscreencap.service
    INSTALLS += dbus_service
#    packaging {
#        servicedbus.files = dbus/package/org.dharkael.kylinscreenshot.service
#    } else {
#        servicedbus.files = dbus/make/org.dharkael.kylinscreenshot.service
#    }

}

RESOURCES += \
    ../rec/resources.qrc

